﻿using Direct.IDAL.Manager.Money;
using DirectSell.Common.Filter;
using DirectSell.Common.Page;
using DirectSell.Common.Session;
using DirectSell.Common.Url;
using Microsoft.Practices.Unity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;

namespace DirectSell.WebLayer.Areas.User.Controllers
{
    /// <summary>
    /// 收支查询
    /// </summary>
    public class EarningController : Controller
    {
        #region 注入
        [Dependency]
        protected IEarningRepository _repository { get; set; }
        #endregion

        #region 首页
        /// <summary>
        /// 首页
        /// </summary>
        /// <param name="page"></param>
        /// <returns></returns>
        [LoginFilter(IsCheck =true)]
        public async Task<ActionResult> Index(int page=1)
        {
            var session = SessionInfo.GetSession();

            var list = await  _repository.QueryEarning(session.UserCode,page,CommonConfig.PageSize);

            return View(list);
        }
        #endregion
    }
}